﻿using System;
using System.Collections.Generic;
using System.Text;
using BlueLotus7.Contract;
using BlueLotus7.Common;
using System.Runtime.Serialization;

namespace BlueLotus7.Contract
{
    [DataContract]
    [KnownType(typeof(BaseObject))]
    public abstract class BaseAccount : BaseObject
    {
        #region Property

        /// <summary>
        /// The login ID.
        /// </summary>
        [DataMember]
        public string LoginId
        {
            get;
            set;
        }

        /// <summary>
        /// The password for login.
        /// </summary>
        [DataMember]
        public string Password
        {
            get;
            set;
        }

        /// <summary>
        /// The content.
        /// </summary>
        [DataMember]
        public AccountStatus Status
        {
            get;
            set;
        }

        #endregion

        #region Constructor

        public BaseAccount(string loginId)
            : base()
        {
            this.LoginId = loginId;
        }

        public BaseAccount(string loginId, Guid createdBy)
            : base(createdBy)
        {
            this.LoginId = loginId;
        }

        public BaseAccount(Guid key, string loginId, string password, DateTime createdStamp, Guid? createdBy, DateTime lastUpdatedStamp, Guid? updatedBy)
            : base(key, createdStamp, lastUpdatedStamp)
        {
            this.LoginId = loginId;
            this.Password = password;
            this.CreatedBy = createdBy;
            this.LastUpdatedBy = updatedBy;
        }

        public BaseAccount(Guid key, string loginId, string password, DateTime createdStamp, DateTime lastUpdatedStamp)
            : this(key, loginId, password, createdStamp, null, lastUpdatedStamp, null)
        {
        }

        #endregion

    }
}
